﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Criterion;
using Spring.Stereotype;
using Spring.Transaction.Interceptor;
using Spring.Data.NHibernate.Support;
using OpenSda.Core.Data;
using OpenSda.Data.NHibernateAccess;
using OpenSda.Agilcont.Common.Data.Contracts;
using OpenSda.Agilcont.Common.Data.Entities;

namespace OpenSda.Agilcont.Common.Data.NhContexts
{
    /// <summary>
    /// Customer related DAO operations implementation.
    /// </summary>
    [Repository]
    public class CustomerData : DataAccess<Customer>, ICustomerData
    {
        [Transaction(ReadOnly = true)]
        public IList<Customer> GetAll2()
        {
            String cmd = @"FROM Customer c";
            IQuery query = GetDefaultSession().CreateQuery(cmd);
            return query.List<Customer>();

        }

        public string MiFun()
        {
            return "Hola";
        }
    }
}
